using UnityEngine;
using System.Collections;

public class GameMaster : MonoBehaviour {
	
	public GameObject playerCharacter;
	public GameObject gameSettings;
	public Camera mainCamera;
	
	private GameObject _pc;
	private PlayerCharacter _pcScript;
	
	// Use this for initialization
	void Start () {
		
		//Створення чара
		_pc = Instantiate(playerCharacter,Vector3.zero,Quaternion.identity) as GameObject;
	    _pc.name = "pc";
		
	    _pcScript = _pc.GetComponent<PlayerCharacter>();
		
		LoadCharacter();
		
	}
	
	
	public void LoadCharacter() {
		GameObject gs = GameObject.Find("__GameSettings");
		
		if(gs == null){
		  GameObject gs1 = Instantiate(gameSettings,Vector3.zero,Quaternion.identity) as GameObject;	
		  gs1.name = "__GameSettings";
		}
		
		    GameSettings gsScript = GameObject.Find("__GameSettings").GetComponent<GameSettings>();
			
			//Load char Data
			gsScript.LoadCharacterData();
		
	}
}
